/**
 * 
 */
package gdr.graphics;

import gdr.dev.Rendable;
import gdr.map.*;
import java.awt.*;
/**
 * Rappresentazione grafica piu' semplice delle caselle dello sfondo.
 * @author Giorgio Vitale
 *
 */
public class BattleMapUnitGraphics implements Rendable{
	
	protected BattleMapUnit mapUnit;
	protected Color color;
	protected CoordinateCalculator coordinateCalc;
	
	public void update(long elapsedTime){
		
	}
	
	public void render(Graphics2D g){
		g.setColor(color);
		g.fillRect(coordinateCalc.getX(mapUnit.getPos()), 
				   coordinateCalc.getY(mapUnit.getPos()), 
				   coordinateCalc.resize(CoordinateCalculator.UNIT_WIDTH), 
				   coordinateCalc.resize(CoordinateCalculator.UNIT_HEIGHT));
		g.setColor(color.darker().darker());
		g.drawRect(coordinateCalc.getX(mapUnit.getPos()), 
				   coordinateCalc.getY(mapUnit.getPos()), 
				   coordinateCalc.resize(CoordinateCalculator.UNIT_WIDTH), 
				   coordinateCalc.resize(CoordinateCalculator.UNIT_HEIGHT));
		
	}
	public BattleMapUnit getMapUnit() {
		return mapUnit;
	}

	public void setMapUnit(BattleMapUnit mapUnit) {
		this.mapUnit = mapUnit;
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public CoordinateCalculator getCoordinateCalc() {
		return coordinateCalc;
	}

	public void setCoordinateCalc(CoordinateCalculator coordinateCalc) {
		this.coordinateCalc = coordinateCalc;
	}
	
	
}
